package com.ling.pl.autoproject.definition.logic.model;

import com.ling.pl.core.commons.annotation.Dict;
import com.ling.pl.core.commons.annotation.ModelProperty;

import javax.persistence.Column;

/**
 * 默认主查询为自己
 */
public class DataQuerySqlJoin {

    @Column(name = "QUERY_ID", length = 36)
    @ModelProperty(comment = "查询id")
    String queryId;

    @Column(name = "NAME", length = 150)
    @ModelProperty(comment = "名称")
    String name;

    @Column(name = "JOIN_TYPE", length = 150)
    @ModelProperty(comment = "连接方式")
    @Dict(code = "builder.entity.joinType", des = "相关N:1（INNER JOIN）,存在1:N（EXISTS (SELECT)）,不存在1:N（NOT EXISTS (SELECT)）,索引/继承-主实体,索引/继承-附属实体,右联接N:1,左外联接 1:N")
    String joinType;

    @Column(name = "RELATION_ID", length = 36)
    @ModelProperty(comment = "关系id", des = "通过jointype查询出定义的关系")
    String relationId;

    @Column(name = "ENTITY_ID", length = 36)
    @ModelProperty(comment = "链接实体", des = "通过jointype查询出定义的关系,主查询时为自己")
    String entityId;

    @Column(name = "COLUMNS", length = 500)
    @ModelProperty(comment = "列")
    String columns;
}
